package com.ice.work.moment.crawler.dao.position.fund;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ice.work.moment.facade.crawler.model.FundPosition;
import com.ice.work.moment.facade.crawler.model.InstitutionalPosition;
import org.springframework.stereotype.Repository;

/**
 * @Description Comment dao
 * @Author DELL
 * @Create 2019-01-10
 * @Since 1.0.0
 */
@Repository
public class FundPositionRepository extends ServiceImpl<IFundPositionMapper, FundPosition> implements IFundPositionRepository {

    @Override
    public FundPosition findByInstitutionalPositionTypeIdAndStockIdAndCloseAtDataStatus(FundPosition fundPosition) {
        return this.baseMapper.selectOne(new QueryWrapper<FundPosition>().lambda().eq(FundPosition::getPositionTypeId, fundPosition.getPositionTypeId())
                .eq(FundPosition::getShareId, fundPosition.getShareId())
                .eq(FundPosition::getCloseAt, fundPosition.getCloseAt()).eq(FundPosition::getDataStatus, fundPosition.getDataStatus()));
    }
}


